﻿var fnCustomAdd = function () {
//    var elements = YAHOO.util.Dom.getElementsByClassName('bd', 'div')[0];
//    //d.style.width = 600;
//    //d.style.height = 400;
//    document.getElementById("EditUIWindow").src = "../Crm/SendNews.aspx";
//    // 
//    var w = [],
//        h = [];
//    w.push(660);
//    h.push(490);
//    YAHOO.example.container.dialog1.configWidth(null, w);
//    YAHOO.example.container.dialog1.configHeight(null, h);
//    //
//    YAHOO.example.container.dialog1.render();
//    YAHOO.example.container.dialog1.fillHeight(elements);
    //    YAHOO.example.container.dialog1.show();
    var pagetitle = "发送短信";
    parent.addTabs(pagetitle, "../../Message/SendMag.aspx");
    parent.NeedRefreshPage = this;
}


var fnCustomDeleteData = function () {
    if (confirm("是否确认删除？")) {
        var recordID = myDataTable.getSelectedRows()[0];
        record = myDataTable.getRecord(recordID);
        var SaveUrl = "../../Crm/BSendSysNews.ashx?r=" + Math.random() + "&num=d&ID=" + record.getData("ID");
        YAHOO.util.Connect.asyncRequest('POST', SaveUrl, {
            success: function (msg) {
                if (msg.responseText == "0") {
                    alert("删除失败！");
                } else {
                    alert("删除成功！");
                    RefreshData();
                }
            },
            failure: function (error) {
                alert("数据错误：" + error.statusText);
            }
        }, null);
    }
    YAHOO.example.container.dialog3.hide();
}

///查看短信内容
var fnShowNewsContent = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条短信！");
        return;
    }

    var pagetitle = "查看短信内容";
    parent.addTabs(pagetitle, "../../Crm/V_DatSysNewsInfo.aspx?ID=" + record.getData("ID") + "&choose=de");
    parent.NeedRefreshPage = this;

}